#ifndef _MAZE_H_
#define _MAZE_H_
/*
 * =====================================================================================
 *
 *       Filename:  Maze.h
 *    Description:  this is Maze class, for define a Maze and print it out
 *
 *        Created:  2009年10月30日 10时09分13秒
 *         Author:  Sanli (), santal.li@gmail.com
 *
 * =====================================================================================
 */
#include <iostream>
#include "../commons/DisjSets.h"

/**
 * print a maze like bellow:
 *
 *         +--+--+--+--+--+--+
 *         |  |  |  |  |  |  |
 *         +--+--+--+--+--+--+
 *         |  |  |  |  |  |  |
 *         +--+--+--+--+--+--+
 *         |  |  |  |  |  |  |
 *         +--+--+--+--+--+--+
 *
 * It base on disjSets algrethome
 *
 */

using namespace std ;


enum relation{
    LEFT , RIGTH , TOP , BOTTEM , NORELATION
};

class Maze
{
    public:
        explicit Maze(int x, int y): countx(x) , county(y) , disjsets( x * y )
        {
            _mazearray = new int[countx * county];
            for(int i = 0 ; i<= (countx * county) - 1 ; i++){
                _mazearray[i] = 0 ;
            }
        }


        void printMaze(){
            for(int i = 0 ; i<= county - 1 ;  i++){
                for (int j = 0 ; j <= countx -1 ; j++){
                    cout<<"+--";
                }
                cout<<"+"<<endl ;

                for (int j = 0 ; j <= countx -1 ; j++){
                    cout<<"|  ";
                }
                cout<<"|"<<endl ;
            }
            for (int j = 0 ; j <= countx -1 ; j++){
                cout<<"+--";
            }
            cout<<"+"<<endl ;

        }


        /**
         * is tow cell near and open 
         **/
        bool isOpenOf2Cell(int cellx , int celly){
                return false ;        
        }


    private:
        relation getCellRelation(int cellx , int celly){
            
                
        }

        /**
         * return the cell's X axis value, if the cell was not a valide cell will throws exceptions
         */
        int getCellX(int cell){
            if(cell > 0 ){

            }
        
        }


        /* 
         * return the cell's Y axis value, if the cell was not a avalide cell will throws exceptions
         * */
        int getCellY(int cell){

        }

    private:

        int countx ; 
        int county ;
        int* _mazearray ;
        DisjSets disjsets ;

} ;

#endif
